<%@page pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<jsp:include page="../admin_head.jsp">
	<jsp:param value="用户信息" name="title" />
</jsp:include>
</head>
<body>
<div class="container-fluid">
		<div class="row">
			<div class="col-md-2"></div>
			<div class="col-md-8">
				<div class="panel panel-success" align="center">
				<div class="panel-heading">
				<h1>课堂教学质量评价系统</h1><br/>当前用户:${user.nickName }&nbsp;&nbsp;&nbsp;
						当前用户角色：${user.userRole }
				&nbsp;&nbsp;&nbsp;&nbsp;<a href="userlist.action?userId=${user.id }"><button class="btn btn-sm btn-success">首页</button></a>
						<a href="${pageContext.request.contextPath }/user/user.action"> <button class="btn btn-sm btn-danger" > <B> 退出登录 </B> </button> </a></div>
				</div>
			
			<jsp:include page="../user/admin_nav.jsp">
					<jsp:param value="用户界面" name="title" />
				</jsp:include>
				<div class="panel panel-success">
				<div class="panel panel-primary" style="margin-left: 300px;width:900px;margin-top:15px">
					<div class="panel-heading">
						<h3 class="panel-title">用户列表</h3>
					</div>
					<div class="panel-body">
							<div class="col-lg-2">
								<a href="${pageContext.request.contextPath }/user/addUser.action?id=${user.id}">
									<button class="btn btn-block btn-primary" type="button">增加用户</button>
								</a>
							</div>
							<div class="col-lg-6"></div>
							<div class="col-lg-4">
								<form role="form" method="post" action="allUserlist.action?id=${user.id}">
									<div class="input-group">
										<span class="input-group-btn">
											<button class="btn btn-primary" type="submit">搜索</button>
										</span>&nbsp;&nbsp;
										<select class="form-control" name="userType" style="width:150px;" >
										<c:if test="${roleList ne null}">
											<c:forEach items="${roleList}" var="role" varStatus="vs">
												<c:if test="${ut eq role.id }">
												<option value="${role.id}" selected="selected">${role.name}</option>
												</c:if>
												<c:if test="${ut ne role.id }">
												<option value="${role.id}">${role.name}</option>
												</c:if>
											</c:forEach>
										</c:if>
									</select>&nbsp;&nbsp;
										<input style="width: 200px" type="text" class="form-control" placeholder="请输入用户名进行搜索" name="nickName" value="${nname }"> 
									</div>
								</form>
							</div>
						<table class="table table-hover table-bordered" style="margin-top: 20px">
							<thead>
								<tr align="center" style="font-weight: bold">
									<td>序号</td>
									<td>登录帐号</td>
									<td>登录密码</td>
									<td>编号</td>
									<td>姓名</td>
									<td>性别</td>
									<td>角色</td>
									<td>所属学院（专业）</td>
									<td>简介</td>
									<td>电话</td>
									<td>邮箱</td>
									<td>添加者</td>
									<td>添加时间</td>
									<td>更新时间</td>
									<td>操作</td>
								</tr>
							</thead>
							<tbody>
								<c:if test="${userList ne null}">
									<c:forEach items="${userList}" var="uservo" varStatus="vs">
										<tr align="center">
											<td>${vs.count }</td>
											<td>${uservo.username }</td>
											<td>${uservo.password }</td>
											<td>${uservo.userCode }</td>
											<td>${uservo.nickName }</td>
											<td>
											<c:if test="${uservo.sex==1}">男</c:if> 
											<c:if test="${uservo.sex==2}">女</c:if>
											</td>
											<td>${uservo.userRole }</td>
											<td>${uservo.departmentName }</td>
											<td>${uservo.introduce }</td>
											<td>${uservo.phone }</td>
											<td>${uservo.email }</td>
											<td>${uservo.adderName }</td>
											<td>${uservo.strAddTime }</td>
											<td>${uservo.strUpdateTime }</td>
											<td><a href="${pageContext.request.contextPath }/user/edit_user.action?id=${uservo.id }&operatorId=${user.id}">
												<button class="btn btn-warning btn-sm" type="button"> 修改</button>
												</a> 
												<a href="${pageContext.request.contextPath }/user/delUser.action?id=${uservo.id }&operatorId=${user.id}">
												<button class="btn btn-danger btn-sm" type="button"> 删除</button>
												</a>
											</td>
										</tr>
									</c:forEach>
								</c:if>
							</tbody>
						</table>
						<button class="btn btn-success" onClick="location.href='userlist.action?userId=${user.id}'">返回</button>
						</div></div></div></div>
			<div class="col-md-2"></div>
		</div>
	</div>
</body>
</html>
